home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 21 / CU Amiga Magazine's Super CD-ROM 21 (1998)(EMAP Images)(GB)[!][issue 1998-04].iso / CUCD / Online / NetPar / Install_Client < prev    next >
Encoding:
Text File  |  1998-01-03  |  4.3 KB  |  176 lines

  1. ; NetPar Client Installation Script
  2. ;
  3. ; NetPar Client © MikeySoft 1997-98 "When Mikey Goes Soft"
  4. ;
  5.  
  6. (transcript "NetPar Installation")
  7.  
  8. (set @default-dest "DEVS:")
  9. (set Action
  10.         (askchoice
  11.                 (prompt "NetPar Client © MikeySoft 1997-98\n\"When Mikey Goes Soft\"\n\nWhat Action do you want to take?")
  12.                 (help @askchoice-help)
  13.                 (choices "Install" "Remove")
  14.                 (default 0)
  15.         )
  16. )
  17.  
  18. (debug "User Action" Action)
  19.  
  20. ;
  21. ; Checking to See if NetPar Client has already been installed
  22. ;
  23. (set FinalAction 0)
  24. (set #OldPar "DEVS:orig_parallel.device")
  25. (if (exists #OldPar (noreq))
  26.    (if (= Action 0)
  27.       (set FinalAction 1)
  28.    )
  29. )
  30.  
  31. ; Debug or Not Debug
  32. (set Mode 0)
  33. (if (= Action 0)
  34.    (set Mode
  35.       (askchoice
  36.          (prompt "What Mode do you want to install?\n\n"
  37.                   "Note: Debug Mode writes log files to SYS:NetParClient.log "
  38.                   "and SYS:NetParInit.log. This is much slower that the regular "
  39.                   "NetPar Client. Only use Debug Mode when trying to "
  40.                   "troubleshoot an unexpected problem.")
  41.          (help @askchoice-help)
  42.          (choices "Normal NetPar Client" "Debug  NetPar Client")
  43.          (default 0)
  44.       )
  45.    )
  46. )
  47.  
  48. (if (= Action 0)
  49.    (if (= Mode 0)
  50.       (set #NewSource "NetPar.device")
  51.    )
  52. )
  53. (if (= Action 0)
  54.    (if (= Mode 1)
  55.       (set #NewSource "NetParDebug.device")
  56.    )
  57. )     
  58.  
  59. ; Start the install
  60. (if (= Action 0)
  61.    ;Is it a New install?
  62.    (if (= FinalAction 0)
  63.       (if (not(exists #OldPar (noreq)))
  64.          (run "rename devs:parallel.device devs:orig_parallel.device"
  65.             (prompt "Renaming DEVS:Parallel.Device into DEVS:Orig_Parallel.Device. "
  66.                     "NetPar Client will replace your Original Parallel.device. If "
  67.                     "this step is skipped, the installation will not be completed."
  68.                     "\n\nNOTE: This Install Script comes with a \"Remove\" option which will "
  69.                     "restore your computer to it\'s original settings.")
  70.            (help @run-help) 
  71.            (confirm)
  72.          )
  73.       )
  74.    )
  75. )
  76.  
  77.  
  78. ; Copy the NetPar.Device
  79. (if (= Action 0)
  80.    (if (exists #OldPar (noreq))
  81.       ; Do the Actual Copy
  82.       (copylib
  83.          (prompt "Copying NetPar Client into DEVS:")
  84.          (help @copylib-help)
  85.          (source #NewSource)
  86.          (dest   "DEVS:")
  87.          (newname "parallel.device")
  88.          (confirm)
  89.       )
  90.    )
  91. )   
  92.  
  93. ; Finally the last user message
  94. (if (= Action 0)
  95.    (if (exists #OldPar (noreq))
  96.       (set HostName
  97.          (askstring
  98.              (prompt "What is the name of the host machine that you "
  99.                      "want to print to? The installer script will "
  100.                      "create a environment variable called PrintHOST "
  101.                      "to store this information. You can manually "
  102.                      "reset this variable later by using the setenv "
  103.                      "AmigaDOS command.")
  104.              (help @askstring-help)
  105.          )
  106.       )
  107.    )
  108. )
  109.  
  110. ;Adding the PrintHOST
  111. (if (= Action 0)
  112.    (if (exists #OldPar (noreq))
  113.        (run "setenv PrintHOST" HostName
  114.              (prompt "Making PrintHOST")
  115.        )
  116.    )
  117. )
  118.  
  119. ;  Saving PrinHost to ENVARC:
  120. (if (= Action 0)
  121.     (if (exists "ENV:PrintHOST" (noreq))
  122.          (run "copy ENV:PrintHOST ENVARC:PrintHOST"
  123.               (prompt "Baking Up PrintHOST")
  124.          )
  125.     )
  126. )
  127.  
  128. ;
  129. (if (= Action 0)
  130.    (if (not (exists #OldPar (noreq)))
  131.       (message "\nWas unable to rename current parallel.device to orig_parallel.device. "
  132.                "Installation was NOT Complete!"
  133.                (all)
  134.       )
  135.    )
  136. )
  137.  
  138. ;
  139. ; Now to check on a removal
  140. (if (= Action 1)
  141.    (if (exists #OldPar (noreq))
  142.       (if (exists "DEVS:parallel.device" (noreq))
  143.          (delete "DEVS:parallel.device"
  144.             (prompt "Deleting old NetPar Client Installation")
  145.             (optional "force")
  146.          )
  147.       )
  148.    )
  149. )
  150.  
  151. (if (= Action 1)
  152.    (if (exists #OldPar (noreq))
  153.       (rename #OldPar "DEVS:parallel.device"
  154.          (prompt "Returning the original parallel.device")
  155.       )
  156.    )
  157. )
  158. (if (= Action 1)
  159.    (if (exists "ENV:PrintHOST" (noreq))
  160.       (delete "ENV:PrintHOST"
  161.          (prompt "Removing PrintHOST")
  162.          (optional "force")
  163.       )
  164.    )
  165. )
  166.  
  167. (if (= Action 1)
  168.    (if (exists "ENVARC:PrintHOST" (noreq))
  169.       (delete "ENVARC:PrintHOST"
  170.           (prompt "Removing PrintHOST")
  171.           (optional "force")
  172.       )
  173.    )
  174. )
  175.  
  176.